public class LoanCalculator {
    int money;
    int month;
    double n;
    double avgInterest;
    double avgCap;
    public LoanCalculator(int money,int month,double n){
        this.money = money;
        this.month = month;
        this.n = n;
    }
    public void calculatorAvgInterest(){
        avgInterest = (month+1)*money*(n/12)/2;
    }

    public void calculatorAvgCap(){
        double x = Math.pow(1+(n/12),month);
        avgCap = month * money*(n/12)*x/(x-1)-money;
    }

    public void print(){
            System.out.println("avgint:" + avgInterest);
            System.out.println("avgcap:" + avgCap);
    }
}
